package com.sharp.demo.controller.portal.relation;

import com.sharp.authorization.dao.common.repository.AcUserRoleService;
import com.sharp.demo.dao.entity.UserWithRoleId;
import com.sharp.demo.dao.mapper.AcRoleWithUserIdDao;
import com.sharp.demo.dao.repository.AcRoleWithUserIdService;
import com.sharp.demo.vo.portal.relation.AcUserWithRoleIdVO;
import com.sharp.kernel.mybatis.repository.BaseMysqlRepository;
import com.sharp.kernel.mybatis.repository.BaseOuterJoinRepository;
import com.sharp.portal.controller.BaseBindRelationController;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Title: RoleUserBindController
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/7/26 18:04
 */
@Slf4j
@Api(value = "角色人员绑定接口", tags = "角色人员绑定接口")
@RestController
@RequestMapping(value = "/role/user/relation")
@SuppressWarnings("rawtypes")
public class RoleUserBindController extends BaseBindRelationController<AcUserWithRoleIdVO> {

    @Resource
    private AcUserRoleService acUserRoleService;
    @Resource
    private AcRoleWithUserIdService acRoleWithUserIdService;

    @Override
    protected BaseOuterJoinRepository<UserWithRoleId, AcRoleWithUserIdDao> repository() {
        return acRoleWithUserIdService;
    }

    @Override
    protected BaseMysqlRepository bindRepository() {
        return acUserRoleService;
    }
}
